

// 1. 引入express
const express = require('express');
const homeRoute = require('./routes/homeRoute')
const adminRoute = require('./routes/adminRoute')
// 2. 创建应用程序
const app = express();

// 3. 创建路由
app.use(homeRoute)
app.use(adminRoute)

app.all('*',(req,res)=> {
    res.send(`<h2>404 not found</h2>`)
})

// 监听端口，启动服务
app.listen(3000,()=> {
    console.log('express server is running in 3000...')
})